1. Field
The present invention relates generally to graphics systems and more particularly to methods and apparatus for controlling the transfer of data from a depth cache to depth buffer.
2. Background Information
Computer graphics systems are commonly used for displaying graphical representations of objects on a two-dimensional video display screen. Current computer graphics systems provide highly detailed representations and are used in a variety of applications. In typical computer graphics systems, an object to be represented on the display screen is broken down into graphics primitives. Primitives are basic components of a graphics display and may include points, lines, vectors and polygons, such as triangles and quadrilaterals. Typically, a hardware/software scheme is implemented to render or draw the graphics primitives that represent a view of one or more objects being represented on the display screen.
The primitives of the three-dimensional objects to be rendered are defined by a host computer in terms of primitive data. For example, when the primitive is a triangle, the host computer may define the primitive in terms of X, Y and Z coordinates of its vertices, as well as the red, green and blue (R, G and B) color values of each vertex. Additional primitive data may be used in specific applications.
Image rendering is the conversion of a high-level object-based description into a graphical image for display on some display device. For example, an act of image rendering occurs during the conversion of a mathematical model of a three-dimensional object or scene into a bitmap image. Another example of image rendering is converting an HTML document into an image for display on a computer monitor. Typically, a hardware device referred to as a graphics-rendering engine performs these graphics processing tasks. Graphics-rendering engines typically render scenes into a memory buffer that is subsequently output to the graphical output device, but it is possible for some rendering-engines to write their two-dimensional output directly to the output device. The graphics-rendering engine interpolates the primitive data to compute the display screen pixels that represent the each primitive, and the R, G and B color values of each pixel.
A graphics-rendering system (or subsystem), as used herein, refers to all of the levels of processing between an application program and a graphical output device. A graphics engine can provide for one or more modes of rendering, including zone rendering. Zone rendering attempts to increase overall 3D rendering performance by employing a zone-sized color and depth cache, also called a render cache. By gaining optimal render cache utilization, pixel color and depth memory read/write bottlenecks are thereby reduced.
In zone rendering, a screen is subdivided into an array of zones. Per-zone instruction bins, used to hold the primitive and state setting instructions required to render each zone sub-image, are generated in a first pass. Whenever it is determined that a primitive intersects (or possibly intersects) a zone, a corresponding primitive instruction is placed in the bin for that zone. Some primitives will intersect more than one zone, in which case the primitive instruction is replicated in the corresponding bins. This process is continued until the entire scene is sorted into the bins. Following the first pass of generating the bins for each zone of the image, a second zone-by-zone rendering pass is performed. In particular, the bins for all the zones are rendered to generate the final image. Each scene is typically rendered one zone at a time.
The size of the zone typically corresponds to the size and organization of the render cache. A render cache stores pixel data that have been recently used by the rendering processor so that this information is more rapidly available to the rendering processor than it is from external memory devices. In particular, the render cache handles intermediate depth reads and writes within each zone. The data is typically written from the render cache into the depth buffer in main memory. For example, depth values are evicted from the render cache to the depth buffer as a result of a context switch or the partial rendering and/or resumption of a scene. Evictions from the render cache to the depth buffer typically occur during rendering of the next zone. However, since the render cache handles intermediate reads and writes, the values evicted from the render cache to the depth buffer do not typically need to be read. Writing values to the depth buffer unnecessarily places substantial load on the memory bus as well as other parts of the system and may slow the operation of the system.
What is needed therefore is a method, apparatus and system for enabling and/or disabling evictions from a depth cache to a corresponding depth buffer.